package io.github.intellij.dlanguage.lexer

class DlangLexerTest : DlangLexerTestBase("lexer") {

    // shebang
    fun testshebang_line() = doTest()

    // keywords
    fun testkeyword_abstract()            = doTest()
    fun testkeyword_deprecated()          = doTest()
    fun testkeyword_final()               = doTest()
    fun testkeyword_nothrow()             = doTest()
    fun testkeyword_override()            = doTest()
    fun testkeyword_pure()                = doTest()
    fun testkeyword_scope()               = doTest()
    fun testkeyword_static()              = doTest()
    fun testkeyword_synchronized()        = doTest()
    fun testkeyword_ref()                 = doTest()
    fun testkeyword_const()               = doTest()
    fun testkeyword_immutable()           = doTest()
    fun testkeyword_inout()               = doTest()
    fun testkeyword_shared()              = doTest()
    fun testkeyword_auto()                = doTest()
    fun testkeyword_alias()               = doTest()
    fun testkeyword_align()               = doTest()
    fun testkeyword_asm()                 = doTest()
    fun testkeyword_assert()              = doTest()
    fun testkeyword_break()               = doTest()
    fun testkeyword_case()                = doTest()
    fun testkeyword_cast()                = doTest()
    fun testkeyword_catch()               = doTest()
    fun testkeyword_class()               = doTest()
    fun testkeyword_continue()            = doTest()
    fun testkeyword_debug()               = doTest()
    fun testkeyword_default()             = doTest()
    fun testkeyword_delegate()            = doTest()
    fun testkeyword_do()                  = doTest()
    fun testkeyword_else()                = doTest()
    fun testkeyword_enum()                = doTest()
    fun testkeyword_extern()              = doTest()
    fun testkeyword_false()               = doTest()
    fun testkeyword_finally()             = doTest()
    fun testkeyword_for()                 = doTest()
    fun testkeyword_foreach()             = doTest()
    fun testkeyword_foreach_reverse()     = doTest()
    fun testkeyword_function()            = doTest()
    fun testkeyword_goto()                = doTest()
    fun testkeyword_if()                  = doTest()
    fun testkeyword_import()              = doTest()
    fun testkeyword_in()                  = doTest()
    fun testkeyword_interface()           = doTest()
    fun testkeyword_invariant()           = doTest()
    fun testkeyword_is()                  = doTest()
    fun testkeyword_lazy()                = doTest()
    fun testkeyword_macro()               = doTest()
    fun testkeyword_mixin()               = doTest()
    fun testkeyword_module()              = doTest()
    fun testkeyword_new()                 = doTest()
    fun testkeyword_null()                = doTest()
    fun testkeyword_out()                 = doTest()
    fun testkeyword_pragma()              = doTest()
    fun testkeyword_return()              = doTest()
    fun testkeyword_struct()              = doTest()
    fun testkeyword_super()               = doTest()
    fun testkeyword_switch()              = doTest()
    fun testkeyword_template()            = doTest()
    fun testkeyword_this()                = doTest()
    fun testkeyword_throw()               = doTest()
    fun testkeyword_true()                = doTest()
    fun testkeyword_try()                 = doTest()
    fun testkeyword_typedef()             = doTest()
    fun testkeyword_typeid()              = doTest()
    fun testkeyword_typeof()              = doTest()
    fun testkeyword_union()               = doTest()
    fun testkeyword_unittest()            = doTest()
    fun testkeyword_version()             = doTest()
    fun testkeyword_volatile()            = doTest()
    fun testkeyword_while()               = doTest()
    fun testkeyword_with()                = doTest()
    fun testkeyword___traits()            = doTest()
    fun testkeyword___gshared()           = doTest()
    fun testkeyword___thread()            = doTest()
    fun testkeyword___vector()            = doTest()
    fun testkeyword___file__()            = doTest()
    fun testkeyword___line__()            = doTest()
    fun testkeyword___module__()          = doTest()
    fun testkeyword___function__()        = doTest()
    fun testkeyword___pretty_function__() = doTest()
    fun testkeyword___date__()            = doTest()
    fun testkeyword___time__()            = doTest()
    fun testkeyword___timestamp__()       = doTest()
    fun testkeyword___vendor__()          = doTest()
    fun testkeyword___version__()         = doTest()


    // comments
    fun testcomment_line() = doTest()
    fun testcomment_doc_line() = doTest()
    fun testcomment_doc_multi() = doTest()
    fun testcomment_doc_nested() = doTest()
    fun testcomment_multi() = doTest()
    fun testcomment_nested() = doTest()

    // Ensure that the parser don’t crash if a comment is unclosed
    fun testcomment_unclosed() = doTest("/* unclosed comment", "DlangTokenType.BLOCK_COMMENT ('/* unclosed comment')")


    //chars
    fun testchar() = doTest()


    // floats
    fun testfloat_decimal() = doTest()
    fun testfloat_hex()     = doTest()


    // integers
    fun testinteger_binary()  = doTest()
    fun testinteger_decimal() = doTest()
    fun testinteger_hex()     = doTest()
    fun testinteger_octal()   = doTest()


    // strings
    fun teststring_delim()   = doTest()
    fun teststring_dq()      = doTest()
    fun teststring_tokens()  = doTest()
    fun teststring_wysiwyg() = doTest()
    fun teststring_hex()     = doTest()

    fun teststring_delim_dash() = doTest("q\"-test-\"d", "DlangTokenType.DELIMITED_STRING ('q\"-test-\"d')")
    // Note q"/te/st/"d is technically invalid in D, but it’s better to have another lexer that ensure it’s a valid DELIMITED_STRING
    fun teststring_delim_multiple_dash() = doTest("q\"/te/st/\"d", "DlangTokenType.DELIMITED_STRING ('q\"/te/st/\"d')")
    fun teststring_delim_invalid() = doTest("q\"_test_\"d", "DlangTokenType.DELIMITED_STRING ('q\"_test_\"d')")
    fun teststring_delim_invalid_non_ending() = doTest("q\"/test\"d;", """
BAD_CHARACTER ('q"/test"d;')
""")
    fun teststring_delim_unterminated() = doTest("q\"test\"", "DlangTokenType.DELIMITED_STRING ('q\"test\"')")
    fun teststring_token_no_extension() = doTest("q{test}", "DlangTokenType.TOKEN_STRING ('q{test}')")

    // ies
    fun teststring_ies()           = doTest()

    // tokens
    fun testtokens_and()                  = doTest()
    fun testtokens_and_assign()           = doTest()
    fun testtokens_assign()               = doTest()
    fun testtokens_at()                   = doTest()
    fun testtokens_close_brace()          = doTest()
    fun testtokens_close_bracket()        = doTest()
    fun testtokens_close_parens()         = doTest()
    fun testtokens_colon()                = doTest()
    fun testtokens_comma()                = doTest()
    fun testtokens_concat()               = doTest()
    fun testtokens_concat_assign()        = doTest()
    fun testtokens_decrement()            = doTest()
    fun testtokens_div()                  = doTest()
    fun testtokens_div_assign()           = doTest()
    fun testtokens_dollar()               = doTest()
    fun testtokens_dot()                  = doTest()
    fun testtokens_double_dot()           = doTest()
    fun testtokens_equals()               = doTest()
    fun testtokens_greater_equal()        = doTest()
    fun testtokens_greater_than()         = doTest()
    fun testtokens_increment()            = doTest()
    fun testtokens_lambda()               = doTest()
    fun testtokens_left_shift()           = doTest()
    fun testtokens_left_shift_assign()    = doTest()
    fun testtokens_less_equal()           = doTest()
    fun testtokens_less_than()            = doTest()
    fun testtokens_logical_and()          = doTest()
    fun testtokens_logical_or()           = doTest()
    fun testtokens_minus()                = doTest()
    fun testtokens_minus_assign()         = doTest()
    fun testtokens_mod()                  = doTest()
    fun testtokens_mod_assign()           = doTest()
    fun testtokens_mult_assign()          = doTest()
    fun testtokens_not()                  = doTest()
    fun testtokens_not_equal()            = doTest()
    fun testtokens_open_brace()           = doTest()
    fun testtokens_open_bracket()         = doTest()
    fun testtokens_open_parens()          = doTest()
    fun testtokens_or()                   = doTest()
    fun testtokens_or_assign()            = doTest()
    fun testtokens_plus()                 = doTest()
    fun testtokens_plus_assign()          = doTest()
    fun testtokens_pow()                  = doTest()
    fun testtokens_pow_assign()           = doTest()
    fun testtokens_question()             = doTest()
    fun testtokens_right_shift()          = doTest()
    fun testtokens_right_shift_assign()   = doTest()
    fun testtokens_semicolon()            = doTest()
    fun testtokens_star()                 = doTest()
    fun testtokens_triple_dot()           = doTest()
    fun testtokens_triple_rshift()        = doTest()
    fun testtokens_triple_rshift_assign() = doTest()
    fun testtokens_unordered_g()          = doTest()
    fun testtokens_unordered_ge()         = doTest()
    fun testtokens_unordered_l()          = doTest()
    fun testtokens_unordered_le()         = doTest()
    fun testtokens_xor()                  = doTest()
    fun testtokens_xor_assign()           = doTest()

    //issue 77
    fun testissue77() = doTest()

    //issue 365
    fun testissue365() = doTest()

    //issue 1159
    fun testissue1159() = doTest()
}
